<script setup lang="ts">
// import { ref } from 'vue'
import Player from '@/components/Player.vue'

// import VideoScale from './VideoScale.vue'

defineProps({
  configOptions: {
    type: Object,
    default: () => {}
  }
})
const emits = defineEmits(['video-scale'])
// const insetRef = ref<InstanceType<typeof VideoScale> | null>(null)
// const outsideRef = ref<InstanceType<typeof VideoScale> | null>(null)
// const realtimeRef = ref<InstanceType<typeof VideoScale> | null>(null)
const videoScaleShow = (id) => {
  emits('video-scale', id)
  // insetRef.value?.open()
  // console.log('======', id)
}
const getVideoAIOptions = (id: string) => {
  return {
    id: id,
    width: '100%',
    height: '100%',
    source:
      'https://vod.play.t-aaron.com/da1b1c30796d71eebfff7035d0b20102/e4c05858dbc94c20ba0ccf9464bd926d-fe8119f756e23f009b954affb89b754b-hd.mp4',
    isLive: false,
    hideControl: true //是否隐藏播放器控制按钮
  }
}
</script>
<template>
  <div class="videoBox">
    <Player :ref="configOptions.id" :options="getVideoAIOptions(configOptions.id)" />
    <div class="growBig" @click="videoScaleShow(configOptions.id)">
      <Icon class="icon" icon="svg-icon:fangda" size="12" />
      <span class="text-[12px]">放大</span>
    </div>
    <p class="title">{{
      configOptions.id === 'inset' ? '舱内' : configOptions.id === 'outside' ? '舱外' : '实时监控'
    }}</p>
  </div>
</template>

<style lang="less" scoped>
* {
  padding: 0;
  margin: 0;
}
.videoBox {
  height: 100%;
  background-color: #1b2b4c;
  margin-bottom: 5px;
  position: relative;
  font-family: Source Han Sans CN;
  .title {
    font-weight: 500;
    font-size: 16px;
    // font-size: 0.9vw;
    line-height: 14px;
    color: #ffffff;
    position: absolute;
    bottom: 8px;
    right: 22px;
  }
  .growBig {
    min-width: 46px;
    height: 20px;
    background: rgba(255, 255, 255, 0.59);
    border: 1px solid #205487;
    position: absolute;
    top: 6px;
    right: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    cursor: pointer;
    .icon {
      margin-right: 10px;
    }
  }
}
@media screen and (max-height: 730px) {
  .title {
    font-size: 14px !important;
  }
  .growBig {
    span {
      font-size: 13px !important;
    }
    .icon {
      width: 10px !important;
      height: 10px !important;
    }
  }
}
</style>
